package kr.co.goodwilldd.framework.file.impl;

import javax.annotation.PostConstruct;

import kr.co.goodwilldd.framework.file.IFileService;
import kr.co.goodwilldd.framework.file.model.FileMeta;
import kr.co.goodwilldd.framework.file.repository.IFileRepository;
import kr.co.goodwilldd.framework.repository.DefaultRepository;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;


@Service
public class FileServiceImpl implements IFileService {

	@Autowired
	IFileRepository iFileRepository;
	
	@Autowired
	DefaultRepository defaultRepository;
	
	@Override
	public FileMeta doSaveFileMeta(FileMeta files) {
		iFileRepository.doSaveFile(files);
		return files;
	}

	@Override
	public FileMeta getFile(String fileSeq) {
		return iFileRepository.getFile(fileSeq);
	}

	@Override
	@PostConstruct
	public void init() {
		defaultRepository.doCreateTableFile();
		defaultRepository.doCreateSequenceFile();
	}

}
